import request from '@/utils/request'
// import {getTokenLocalStorage, getUserIDLocalStorage} from "@/utils/utilLocalStorage";

//学生获取课程
export function getStudentCoursesAPI(studentId) {
    return request({
        url: '/courses/' + studentId,
        method: 'GET',
    })
}
//老师获取课程
export function getTeacherCoursesAPI(teacherId) {
    return request({
        url: '/courses/' + teacherId,
        method: 'GET',
    })
}
//通过课程id获取课程信息接口 /courses/getByCourseId/{courseId}
export function getCourseByCourseIdAPI(courseId) {
    return request({
        url: '/courses/getByCourseId/' + courseId,
        method: 'GET',
    })
}

//新增课程
export function addCourseAPI(data) {
    return request({
        url: '/courses',
        method: 'POST',
        data
    })
}

//删除课程
export function deleteCourseAPI(courseId) {
    return request({
        url: '/courses/'+ courseId,
        method: 'DELETE' ,
        
    })
}

//修改课程
export function editCourseAPI(courseId,data) {
    return request({
        url: '/courses/' + courseId ,
        method: 'PUT',
        data
    })
}
